//
//  KLMAPI.swift
//  KLM_GN
//
//  Created by Nic on 2025/3/12.
//

import Foundation

struct API {
    
    //MARK: - 登录、注册相关
    static let getEmailCode = "open/email/codeByAppAndLanguage"
    static let getPhoneCode = "open/app/sms-code"
    static let login = "api/auth/login"
    static let logout = "api/auth/logout"
    static let signOutUser = "api/user/delete"
    static let smsCodeLogin = "open/app/sms-code-login"
    static let register = "api/auth/register"
    static let forgetPwd = "api/auth/forget/password"
    static let updatePwd = "api/auth/update/password"
    static let updateUserInfo = "api/v2/saas/app/user/update_user_info"
    static let queryUserInfo = "api/v2/saas/app/user/user_advanced_info"
    
    //MARK: - 家庭相关
    /// 创建家庭
    static let createHome = "api/v2/saas/app/mesh/create_home"
    static let leaveHome = "api/mesh/signOut"
    static func deleteHome(id: Int) -> String {"api/mesh/\(id)"}
    /// 查询家庭列表
    static let queryHomeList = "api/v2/saas/app/mesh/query_mesh_list"
    /// 查询家的信息
    static let queryHomeInfo = "api/v2/saas/app/mesh/query_mesh"
    /// 更新家的名字
    static let updateHomeName = "api/v2/saas/app/mesh/update_mesh"
    /// 获取家中所有成员
    static let getUserList = "api/v2/saas/app/mesh/query-home-user-list"
    /// 获取单人邀请码
    static let getSingleCode = "api/v2/saas/app/mesh/generate-invite-user-code"
    /// 提降用户权限
    static let updateUserRole = "api/v2/saas/app/mesh/promote_demote_mesh_user"
    /// 单人邀请码加入家庭
    static let joinHome = "api/v2/saas/app/mesh/invited-user-join"
    /// 转移家庭拥有者权限
    static let transferHomeOwner = "api/v2/saas/app/mesh/transfer_mesh_ownership"
    /// 删除家中某个用户
    static let deleteHomeUser = "api/v2/saas/app/mesh/delete_mesh_user"
    /// 更新家中用户昵称
    static let updateHomeUserInfo = "api/v2/saas/app/mesh/update-home-user-info"
    /// 查询家中用户信息
    static let queryHomeUserInfo = "api/v2/saas/app/mesh/query_mesh_user_info"
    
    //MARK: - 房间相关
    /// 家中房间列表
    static let queryHomeRoomList = "api/v2/saas/app/room/query-home-room-list"
    /// 新增房间
    static let createHomeRoom = "api/v2/saas/app/room/create-home-room"
    /// 删除家中房间
    static let deleteHomeRoom = "api/v2/saas/app/room/delete-home-room"
    /// 家中房间重命名
    static let updateHomeRoomName = "api/v2/saas/app/room/update-home-room"
    /// 家中房间所有设备列表
    static let homeRoomDeviceList = "api/v2/saas/app/room/query-home-room-device-list"
    /// 家房间中移入设备
    static let homeRoomAddDevice = "api/v2/saas/app/room/add-home-room-device"
    /// 家房间中移出设备
    static let homeRoomRemoveDevice = "api/v2/saas/app/room/remove-home-room-device"
    
    //MARK: - 设备相关
    /// 连接家和服务器的心跳，获取权限
    static let connectHomeHeart = "api/v2/saas/app/mesh/mobile_heart"
    /// 家中所有设备
    static let queryhomeDeviceList = "api/v2/saas/app/device/query-home-device-list"
    /// 获取mesh配网中的地址
    static let getProvisiosnAddress = "api/meshApp/message"
    /// 申请设备可用单播地址
    static let getUnicastAddress = "api/v2/saas/app/device/apply_unicast_address"
    /// 新增家中设备
    static let homeCreateDevice = "api/v2/saas/app/device/create_device"
    /// 家中房间新增设备
    static let homeRoomCreateDevice = "api/v2/saas/app/device/create-home-room-device"
    /// 删除家中设备 { meshId，uuid }
    static let homeDeleteDevice = "api/v2/saas/app/device/delete_device_by_uuid"
    
    /// 查询设备参数 { uuid }
    static let queryDeviceProfile = "api/v2/saas/app/configdata/query_device_profile"
    /// 配置设备参数 { uuid,  }
    static let configDeviceProfile = "api/v2/saas/app/configdata/config_device_profile"
    /// 更新设备信息 { meshId,  uuid }
    static let updateDeviceInfo = "api/v2/saas/app/device/update_device"
    
    //MARK: - AI模式、情景模式
    /// 查询rk设备绑定场景列表
    static let queryRKDeviceSceneList = "api/v2/saas/app/rkdevice/query_rkdevice_scene"
    /// 查询家中自定义场景列表
//    static let querySceneList = "api/v2/saas/app/scene/query_scene_list"
    /// 新增场景
    static let createScene = "api/v2/saas/app/scene/create_scene"
    /// 删除场景
    static let deleteScene = "api/v2/saas/app/scene/delete_scene"
    /// 更新场景
    static let updateScene = "api/v2/saas/app/scene/update_scene"
    /// 更新rk设备内置场景开关
    static let updateRKSceneButton = "api/v2/saas/app/rkdevice/update_scene_button"
    /// 远程执行场景
    static let remoteControlScene = "api/v2/saas/app/configdata/remote_control_scene"
}
